/**
 * @format
 */

import React from 'react';
import { AppRegistry, Text } from 'react-native';
import { name as appName } from './app.json';
import { PersistGate } from 'redux-persist/integration/react';
import { StoreContext } from 'redux-react-hook';
import store, { persistor } from './src/redux/store';
import App from './App';
// 添加Firebase初始化
import firebase from '@react-native-firebase/app';

function FindApp() {
  // 初始化Firebase应用（如果还没有初始化）
if (!firebase.apps.length) {
  console.log('初始化')
  firebase.initializeApp();
}
  return (
    <StoreContext.Provider value={store}>
      <PersistGate loading={null} persistor={persistor}>
        <App/>
      </PersistGate>
    </StoreContext.Provider>
  );
}

AppRegistry.registerComponent(appName, () => FindApp);
